<template>
  <section class="app-container">
    <!--工具条-->
    <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
      <el-form :inline="true" :model="filters" @submit.native.prevent>
        <el-form-item>
          <el-input v-model="filters.name" placeholder="赛事名称"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" v-on:click="getConclusion">查询</el-button>
        </el-form-item>
      </el-form>
    </el-col>


    <!--列表-->
    <el-table :data="conclusionData" highlight-current-row @selection-change="selsChange" style="width: 100%;">
      <el-table-column type="selection" width="55">
      </el-table-column>
      <el-table-column type="index" width="60">
      </el-table-column>
      <el-table-column prop="project.name" label="赛事名称" min-width="120">
      </el-table-column>
      <el-table-column prop="capital.bonus" sortable label="奖金" min-width="100" >
      </el-table-column>
      <!--<el-table-column prop="teacherNo" label="项目负责人" min-width="120" :formatter="formatTeacherNo">
      </el-table-column>-->
      <el-table-column prop="teamNo" label="团队编号" min-width="120">
      </el-table-column>
      <el-table-column prop="prize.ranking" label="获奖名次" min-width="120" :formatter="formatRanking">
      </el-table-column>
      <el-table-column prop="prize.level" label="获奖级别" min-width="120" :formatter="formatLevel">
      </el-table-column>
      <el-table-column
        prop="status"
        label="审核状态"
        width="100"
        filter-placement="bottom-end">
        <template slot-scope="scope">
          <el-tag v-if="scope.row.status == '0'"
                  :type="scope.row.status === '3' ? 'primary' : 'success'"
                  disable-transitions>待提交</el-tag>
          <el-tag v-if="scope.row.status == '1'"
                  :type="scope.row.status === '3' ? 'primary' : 'success'"
                  disable-transitions >待审核</el-tag>
          <el-tag v-if="scope.row.status == '3'"
                  :type="scope.row.status === '3' ? 'primary' : 'success'"
                  disable-transitions>已通过</el-tag>
          <el-tag v-if="scope.row.status == '2'"
                  :type="scope.row.status === '3' ? 'primary' : 'success'"
                  disable-transitions>不通过</el-tag>
        </template>
      </el-table-column>
      <!--<el-table-column prop="status" label="审核状态" width="100" :formatter="formatStatus">
      </el-table-column>-->

      <el-table-column label="操作" width="240" align="center">
        <template slot-scope="scope">
          <el-button @click="handleExamine(scope.$index, scope.row)" v-show="scope.row.status == '1'" type="text" size="small">通过</el-button>
          <el-button type="text" @click="disapprove(scope.$index, scope.row)" v-show="scope.row.status == '1'"  size="small">不通过</el-button>
          <el-button type="text" @click="handleDetail(scope.$index, scope.row)">详情</el-button>
        </template>

      </el-table-column>
    </el-table>
    <!--分页工具-->
    <el-pagination
      background
      @size-change="handleSizeChange"
      :current-page="page"
      @current-change="handleCurrentChange"
      :page-sizes="[10, 20, 50, 100]"
      :page-size="limit"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total">
    </el-pagination>


    <!--编辑界面-->
    <el-dialog
      title="项目结题"
      width="60%"
      height="60%"
      :visible.sync="dialogFormVisible"
      :close-on-click-modal="false">
      <el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm">
        <el-row>
          <el-col :span="8">
            <el-form-item label="赛事名称" prop="project.name">
              <el-input v-model="editForm.project.name" disabled auto-complete="off" ></el-input>
              <!--<el-select v-model="competitionName" :disabled="dialogStatus == 'detail'" filterable placeholder="请选择赛事名称">
                <el-option
                        v-for="item in projectList"
                        :key="item.name"
                        :label="item.name"
                        :value="item.name">
                </el-option>
              </el-select>-->
            </el-form-item>
            <el-form-item label="获奖名次" prop="prize.ranking">
              <el-select v-model="editForm.prize.ranking" disabled filterable placeholder="请选择获奖名次">
                <el-option label="特等奖" value="14">
                </el-option>
                <el-option label="一等奖" value="1">
                </el-option>
                <el-option label="二等奖" value="2">
                </el-option>
                <el-option label="三等奖" value="3">
                </el-option>
                <el-option label="优秀奖" value="5">
                </el-option>
                <el-option label="无" value="0">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="获奖级别" prop="prize.level">
<!--              <el-input v-model="editForm.prize.level" :disabled="dialogStatus == 'detail'" auto-complete="off" ></el-input>-->
              <el-select v-model="editForm.prize.level" disabled filterable placeholder="请选择获奖名次">
                <el-option label="国家级" value="14">
                </el-option>
                <el-option label="区级" value="1">
                </el-option>
                <el-option label="校级" value="2">
                </el-option>
                <el-option label="无" value="0">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="注册费" prop="capital.enroll">
              <el-input-number v-model="editForm.capital.enroll" :min="0" disabled></el-input-number>
            </el-form-item>
            <el-form-item label="差旅费" prop="capital.travel">
              <el-input-number v-model="editForm.capital.travel" :min="0" disabled></el-input-number>
            </el-form-item>

          </el-col>
          <el-col :span="8">
            <el-tooltip class="item" effect="dark" content="请先选择赛事名称，并选择对应的项目编号" placement="top">
              <el-form-item label="项目编号" prop="applyId">
                <el-input v-model="editForm.applyId" disabled auto-complete="off" ></el-input>
                <!--<el-select v-model="editForm.applyId" :disabled="dialogStatus == 'detail'" filterable placeholder="请选择赛事名称">
                  <el-option
                          v-for="item in projectData"
                          :key="item.projectId"
                          :label="item.projectId"
                          :value="item.projectId">
                  </el-option>
                </el-select>-->
              </el-form-item>
            </el-tooltip>
            <el-form-item label="培训费" prop="capital.train">
              <el-input-number v-model="editForm.capital.train" :min="0" disabled></el-input-number>
            </el-form-item>
            <el-form-item label="指导费" prop="capital.guide">
              <el-input-number v-model="editForm.capital.guide" :min="0" disabled></el-input-number>
            </el-form-item>
            <el-form-item label="耗材费" prop="capital.consume">
              <el-input-number v-model="editForm.capital.consume" :min="0" disabled></el-input-number>
            </el-form-item>
            <el-form-item label="奖金" prop="capital.bonus">
              <el-input-number v-model="editForm.capital.bonus" :min="0" disabled ></el-input-number>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="团队编号" prop="teamNo">
              <el-input v-model="editForm.teamNo" disable auto-complete="off" disabled></el-input>
              <!--<el-select v-model="selectTeamNo" :disabled="dialogStatus == 'detail'" filterable placeholder="请选择团队编号">
                <el-option
                        v-for="item in teamData"
                        :key="item.id"
                        :label="item.teamNo"
                        :value="item.teamNo">
                </el-option>
              </el-select>-->
            </el-form-item>
            <el-form-item label="评审费" prop="capital.review">
              <el-input-number v-model="editForm.capital.review" :min="0" disabled ></el-input-number>
            </el-form-item>
            <el-form-item label="领队费" prop="capital.lead">
              <el-input-number v-model="editForm.capital.lead" :min="0" disabled ></el-input-number>
            </el-form-item>
            <el-form-item label="组织费" prop="capital.organize">
              <el-input-number v-model="editForm.capital.organize" :min="0" disabled ></el-input-number>
            </el-form-item>
            <el-form-item label="合计">
              <el-input-number v-model="editForm.capital.sum" disabled ></el-input-number>
            </el-form-item>
          </el-col>
          <!--          <el-form-item label="团队成员列表">-->
          <!--          </el-form-item>-->
          <el-table :data="memberData" highlight-current-row @selection-change="selsChange" style="width: 100%;border: solid slategray 1px">
            <el-table-column prop="studentNo" label="学生学号" min-width="80">
            </el-table-column>
            <el-table-column prop="studentName" label="学生姓名" min-width="80">
            </el-table-column>
            <el-table-column prop="collegeName" label="所属学院" min-width="120">
            </el-table-column>
            <el-table-column prop="className" label="班级名称" min-width="120">
            </el-table-column>
            <el-table-column prop="grade" label="年级" min-width="100">
            </el-table-column>
            <el-table-column prop="major" label="专业" min-width="100">
            </el-table-column>
            <el-table-column prop="mail" label="邮箱" min-width="120">
            </el-table-column>
            <el-table-column prop="mobileNumber" label="手机号码" min-width="120">
            </el-table-column>
          </el-table>

          <div style="margin-left: 50px;clear: both">
            <a v-show="dialogStatus == 'update'"  :href="'http://cqfimages.gxuwzapp.top/'+ editForm.file" target="_blank">{{conclusionFile}}</a>
<!--            <a v-show="dialogStatus == 'update'"  :href="'http://127.0.0.1:8888/subject/file/'+ editForm.file" target="_blank">{{conclusionFile}}</a>-->
<!--            <a v-show="dialogStatus == 'add'" :href="fileUrl" target="_blank">{{fileName}}</a>-->
          </div>

          <!--        详情信息-->
          <el-form-item v-show="dialogStatus == 'detail'" label="项目结题报告书" prop="file" style="margin-top: 18px">
            <el-input v-show="dialogStatus == 'detail'" v-model="conclusionFile" :disabled="dialogStatus == 'detail'" auto-complete="off"></el-input>
            <a :href="'http://cqfimages.gxuwzapp.top/'+ editForm.file" target="_blank" v-show="dialogStatus != 'add' && editForm.file!= undefined">预览结题附件</a>
<!--            <a :href="'http://127.0.0.1:8888/subject/file/'+ editForm.file" target="_blank" v-show="dialogStatus != 'add' && editForm.file!= undefined">预览结题附件</a>-->
          </el-form-item>
        </el-row>
      </el-form>


      <el-form :model="editForm" label-width="120px" v-show="dialogStatus == 'detail'" style="margin-top: 18px" ref="editForm">
        <el-row>
          <!--          <input type="hidden" v-model="projectForm.id">-->
          <el-col :span="8">
            <el-form-item label="申请立项日期" prop="project.projectDate" >
              <el-date-picker
                      v-model="editForm.project.projectDate"
                      type="datetime"
                      disabled
                      value-format="yyyy-MM-dd HH:mm:ss"
                      placeholder="选择日期时间">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="指导老师" prop="project.teacherId">
              <el-input v-model="editForm.project.teacherId" disabled auto-complete="off" style="width: 220px;"></el-input>
            </el-form-item>
            <el-form-item label="竞赛结束日期" prop="project.endDate">
              <el-date-picker
                      v-model="editForm.project.endDate"
                      type="datetime"
                      disabled
                      value-format="yyyy-MM-dd HH:mm:ss"
                      placeholder="选择日期时间">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="竞赛起始日期" prop="project.startDate">
              <el-date-picker
                      v-model="editForm.project.startDate"
                      type="datetime"
                      disabled
                      value-format="yyyy-MM-dd HH:mm:ss"
                      placeholder="选择日期时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="专业" prop="project.major">
              <el-input v-model="editForm.project.major" disabled auto-complete="off" style="width: 220px;"></el-input>
            </el-form-item>
            <el-form-item label="组赛单位" prop="project.organization">
              <el-input v-model="editForm.project.organization" disabled auto-complete="off" style="width: 220px;"></el-input>
            </el-form-item>
            <el-form-item label="赛制" prop="project.format">
              <el-radio-group v-model="editForm.project.format" >
                <el-radio disabled class="radio" label="1">单人赛</el-radio>
                <el-radio disabled class="radio" label="2">团体赛</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="主办单位" prop="project.sponsor" >
              <el-input v-model="editForm.project.sponsor" disabled auto-complete="off" style="width: 180px;"></el-input>
            </el-form-item>
            <el-form-item label="联系电话" prop="project.phone">
              <el-input v-model="editForm.project.phone" disabled auto-complete="off" style="width: 180px;"></el-input>
            </el-form-item>
            <el-form-item label="邮件" prop="project.mail">
              <el-input v-model="editForm.project.mail" disabled auto-complete="off" style="width: 180px;"></el-input>
            </el-form-item>
            <el-form-item label="竞赛承办单位" prop="project.contractor">
              <el-input v-model="editForm.project.contractor" disabled auto-complete="off" style="width: 180px;"></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-form-item label="论证组赛的目的和意义" prop="project.objective">
          <el-input type="textarea" v-model="editForm.project.objective" disabled auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="审核意见" v-show="editForm.project.opinion != undefined">
          <el-input type="textarea" v-model="editForm.project.opinion" disabled auto-complete="off"></el-input>
        </el-form-item>

        <!--        详情信息-->
        <el-form-item v-show="dialogStatus == 'detail'" label="竞赛邀请函或通知附件" prop="project.invitation">
          <el-input v-show="dialogStatus == 'detail'" v-model="fileName" disabled auto-complete="off"></el-input>
          <a :href="'http://cqfimages.gxuwzapp.top/'+ editForm.project.invitation" target="_blank" v-show="dialogStatus != 'add' && editForm.project.invitation != undefined">预览项目立项附件</a>
<!--          <a :href="'http://127.0.0.1:8888/subject/file/'+ editForm.project.invitation" target="_blank" v-show="dialogStatus != 'add' && editForm.project.invitation != undefined">预览项目立项附件</a>-->
        </el-form-item>

        <div style="margin-left: 50px;clear: both">
          <a :href="'http://cqfimages.gxuwzapp.top/'+ editForm.project.invitation" v-show="dialogStatus != 'detail'" target="_blank">{{fileName}}</a>
<!--          <a :href="'http://127.0.0.1:8888/subject/file/'+ editForm.project.invitation" v-show="dialogStatus != 'detail'" target="_blank">{{fileName}}</a>-->
        </div>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false" v-show="dialogStatus != 'detail'">取 消</el-button>
        <el-button @click.native="dialogFormVisible=false"  v-show="dialogStatus == 'detail'">关闭</el-button>
<!--        <el-button v-if="dialogStatus != 'detail'" type="primary" @click="conclusionSave">保 存</el-button>-->

      </div>
    </el-dialog>

    <!--    审核意见界面-->
    <el-dialog
      title="项目结题审核"
      :visible.sync="opinionDialogVisible"
      width="30%">
      <el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm">
        <el-form-item label="审核意见" prop="opinion">
          <el-input type="textarea" v-model="editForm.opinion" auto-complete="off"></el-input>
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="opinionDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="examine">确 定</el-button>
      </span>
    </el-dialog>

  </section>
</template>

<script>

  export default {
    data(){
      return{
        conclusionData:[],   // 项目结题信息
        teacherList:[],  // 全部教师信息
        prizeList:[],    // 获奖信息
        memberList:[], // 全部的团队成员信息
        projectList:[],  // 审核通过的项目信息
        memberData:[],  // 团队成员信息存储
        memberIndex:0,   // 当前选中团队成员的索引
        teamData:[],    // 团队信息存储
        fileName:'',      // 上传的文件名称
        selectTeamNo:'', // 选中的团队编号
        conclusionFile:"", // 结题附件名称
        opinionDialogVisible: false, // 审核意见对话框
        member:{        // 单个团队成员信息
          teamNo:"",
          studentNo:"",
          studentName:"",
          collegeName:"",
          className:"",
          grade:"",
          major:"",
          mail:"",
          mobileNumber:"",
        },
        total: 0,
        page: 1,  // 当前页
        limit: 10,  // 每页数量
        projectData: [],  // 存储项目信息
        sels: [], // 列表选中列
        competitionName:"", // 选择的赛事名称
        fileName:'',      // 上传的文件名称
        filters: {
          name: ''
        },
        dialogStatus:"",
        memberStatus:"",
        dialogFormVisible: false,
        innerVisible:false,
        textMap: {
          update: '项目结题',
          detail: "项目结题详情",
        },
        // 项目信息
        projectForm:{
          id:0,
          projectId:0,
          budgetId:0,
          status:"",
          opinion:"",
          // 项目基本信息
          name:"",
          charge:"",
          major:"",
          format:"",
          projectDate:"",
          sponsor:"",
          contractor:"",
          objective:"",
          invitation:[],
          phone:"",
          mail:"",
          organization:"",
          startDate:"",
          endDate:"",
        },
        // 编辑界面数据
        editForm: {
          conclusionId:0,
          // name:"",
          applyId:"",
          teamNo:"",
          teacherId:"",
          prizeId:"",
          capitalId:"",
          status:"",
          opinion:"",
          file:"",
          // 项目基本信息
          project: {
            projectId:"",
            name: "",
            teacherId: "",
            major: "",
            format: "",
            projectDate: "",
            sponsor: "",
            contractor: "",
            objective: "",
            invitation: [],
            phone: "",
            mail: "",
            organization: "",
            startDate: "",
            endDate: "",
          },

          // memberNo:"",
          // studentNo:"",
          // studentName:"",
          // collegeName:"",
          // className:"",
          // grade:"",
          // major:"",
          // mail:"",
          // mobileNumber:"",

          // 获奖情况
          prize: {
            prizeId: 0,
            ranking: "",
            level: "",
          },

          // 实际资金使用
          capital: {
            capital: 0,
            enroll: 0,
            travel: 0,
            train: 0,
            guide: 0,
            bonus: 0,
            other: 0,
            consume: 0,
            review: 0,
            lead: 0,
            organize: 0,
            sum: 0,
          }
        },
        // 数据校验
        editFormRules: {
          opinion:[{ required: true, message: '请输入审核意见', trigger: 'blur' }],
          // 获奖
          ranking:[{ required: true, message: '请选择获奖名次', trigger: 'blur' }],
          level:[{ required: true, message: '请选择获奖级别', trigger: 'blur' }],
          // 资金
          enroll: [{ required: true, message: '请输入注册费', trigger: 'blur' }],
          travel: [{ required: true, message: '请输入差旅费', trigger: 'blur' }],
          train: [{ required: true, message: '请输入培训费', trigger: 'blur' }],
          guide: [{ required: true, message: '请输入指导费', trigger: 'blur' }],
          consume: [{ required: true, message: '请输入耗材费', trigger: 'blur' }],
          bonus: [{ required: true, message: '请输入奖金', trigger: 'blur' }],
          review:[{ required: true, message: '请输入评审费', trigger: 'blur' }],
          lead:[{ required: true, message: '请输入指导费', trigger: 'blur' }],
          organize:[{ required: true, message: '请输入组织费', trigger: 'blur' }],
        },
        projectFormRules:{
          name: [{ required: true, message: '请输入赛事名称', trigger: 'blur' }],
          // charge: [{ required: true, message: '请输入项目负责人', trigger: 'blur' }],
          major: [{ required: true, message: '请输入专业', trigger: 'blur' }],
          format: [{ required: true, message: '请选择赛制', trigger: 'blur' }],
          mail: [{ required: true, message: '请输入邮件', trigger: 'blur' }],
          phone: [{ required: true, message: '请输入联系电话', trigger: 'blur' }],
          projectDate: [{ required: true, message: '请输入申请立项日期', trigger: 'blur' }],
          sponsor: [{ required: true, message: '请输入主办单位', trigger: 'blur' }],
          // charge: [{ required: true, message: '请输入项目负责人', trigger: 'blur' }],
          organization: [{ required: true, message: '请输入组赛单位', trigger: 'blur' }],
          startDate: [{ required: true, message: '请输入竞赛起始日期', trigger: 'blur' }],
          endDate: [{ required: true, message: '请输入竞赛结束日期', trigger: 'blur' }],
          contractor: [{ required: true, message: '请输入竞赛承办单位', trigger: 'blur' }],
          objective: [{ required: true, message: '请输入论证组赛的目的和意义', trigger: 'blur' }],
          projectDate: [{ required: true, message: '请输入申请立项日期', trigger: 'blur' }],
          invitation: [{ required: true, message: '请上传竞赛邀请函或通知附件', trigger: 'blur' }],

        },
        memberRules:{
          studentNo: [{required: true, message: '请输入学生学号', trigger: 'blur'}],
          studentName: [{required: true, message: '请输入学生姓名', trigger: 'blur'}],
          className: [{required: true, message: '请输入班级名称', trigger: 'blur'}],
          collegeName: [{required: true, message: '请输入所属学院', trigger: 'blur'}],
          grade: [{required: true, message: '请输入年级', trigger: 'blur'}],
          major: [{required: true, message: '请输入专业', trigger: 'blur'}],
          mail: [{required: true, message: '请输入邮箱', trigger: 'blur'}],
          mobileNumber: [{required: true, message: '请输入手机号码', trigger: 'blur'}],
        },
      }

    },
    mounted(){
      this.getConclusion();
      this.getTeam()
      this.getProject();
    },
    watch:{
      // // 监听选中的赛事名称
      // competitionName(value){
      //   console.log("监听选中的赛事名称")
      //   this.projectData = [];
      //   this.projectList.forEach((obj)=>{
      //     console.log("xun");
      //     if (obj.name == value){
      //       this.projectData.push(obj);
      //       // console.log("相等" + JSON.stringify(this.projectData));
      //     }
      //   });
      // }
    },
    methods:{
      // 查询项目结题信息
      getConclusion(){
        let _this = this;
        let params = {
          name: this.filters.name,
          page: this.page,
          limit: this.limit,
          teacherId: "",
          status:"1",
        }

        this.http.get("conclusion/list",{params: params})
                .then(function (res) {
                  _this.conclusionData = res.data.data.list;
                  _this.memberList = res.data.data.member;
                  _this.total = res.data.data.total;
                }).catch(error => {
          console.log("conclusion- error --->", error)
        });
        // this.getTeacherList();


      },
      // 查询全部教师
      getTeacherList(){
        const _this = this;
        _this.http.get("teacher/list").then(res => {
          _this.teacherList = res.data;
        }).catch(error => {
          console.log("teacher error", error)
        });

      },
      // 查询项目信息
      getProject: function () {
        let charge = localStorage.getItem("teacherId");
        // 判断当前用户是否是教师
        if (charge === 'undefined' || charge === 'null' || charge === undefined || charge === null) {
          charge = "";
        }
        const _this = this;
        let params = {
          status:"3",
          name: this.filters.name,
          page: this.page,
          limit: this.limit,
          teacherId:charge,
        }
        _this.http.get("project/list", {params:params}).then(res =>{
          _this.projectList = res.data.data.list;
        }).catch(error => {
          console.log("error->", error)
        })
      },
      // 查询团队信息
      getTeam: function () {
        let teacher = localStorage.getItem("teacherId");
        // 判断当前用户是否是教师
        if (teacher === 'undefined' || teacher === 'null' || teacher === undefined || teacher === null){
          teacher = "";
        }
        let _this = this;
        this.http({
          url: "team/list",
          method: "post",
          data: {
            title: this.filters.name,
            page: this.page,
            limit: this.limit,
            teacherId: teacher,
          },
        }).then(res => {
          _this.teamData = res.data.data.list;

        });
      },
      // 审核
      examine() {
        let _this = this;
        _this.http({
          url: "conclusion/commit",
          data: {
            conclusionId:this.editForm.conclusionId,
            prizeId:this.editForm.prizeId,
            capitalId:this.editForm.capitalId,
            teamNo:this.editForm.teamNo,
            status: this.editForm.status,
            opinion: this.editForm.opinion,
          },
          method: "post",

        }).then(res =>{
          if (res.data.code === 666) {
            _this.getConclusion();
            _this.$message({
              message: "提交成功",
              type: 'success'
            });
          } else {
            _this.$message({
              message: res.data.message,
              type: 'error'
            });
          }
        });
        this.opinionDialogVisible = false;
      },

      // 显示新增界面
      handleAdd: function () {
        this.dialogStatus = 'add'
        this.dialogFormVisible = true;
        // 置空
        this.memberData = [];
        this.editForm = {};
      },
      handleAddTeam(){
        this.memberStatus = "add";
        this.innerVisible = true;
        this.member = {};
      },
      // 显示编辑界面
      handleEdit(index, row) {
        // this.competitionName = row.name;
        this.memberData = [];
        this.projectForm = {};
        this.dialogStatus = 'update'
        this.dialogFormVisible = true;
        this.projectList.forEach((obj)=>{
          if(row.projectId == obj.projectId){
            this.projectForm = obj;
          }
        });
        this.memberList.forEach((obj)=>{
          if(row.teamNo === obj.teamNo){
            this.memberData.push(obj);
          }
        });
        this.editForm = Object.assign({}, row)
      },
      // 显示项目结题界面
      handleCon(index, row){
        this.dialogFormVisible = true;
        this.dialogStatus = 'update';
        this.memberData = [];
        this.memberList.forEach((obj)=>{
          if(row.teamNo === obj.teamNo){
            this.memberData.push(obj);

          }
        });
        this.editForm = Object.assign({}, row)
      },
      // 获取当前通过审核的项目信息
      handleExamine(index, row) {
        // 获取当前选中信息
        this.editForm = Object.assign({}, row);
        this.editForm.status = "3";
        this.opinionDialogVisible = true;
        // this.examine();
      },
      // 获取当前不通过审核的项目信息
      disapprove(index, row){
        this.editForm.opinion = "";
        this.opinionDialogVisible = true;
        // 获取当前选中信息
        this.editForm = Object.assign({}, row);
        this.editForm.status = "2";
      },
      // 显示详情框
      handleDetail(index, row){
        this.dialogStatus = 'detail';
        this.dialogFormVisible = true;
        this.memberData = [];
        // 获取当前选中的项目立项附件信息
        if(row.project.invitation != undefined) {
          this.fileName = row.project.invitation.substring(row.project.invitation.lastIndexOf("_") + 1);
        }else{
          this.fileName = "";
        }
        // 获取当前选中的项目结题附件信息
        if(row.project.invitation != undefined) {
          this.conclusionFile = row.file.substring(row.file.lastIndexOf("_") + 1);
        }else{
          this.conclusionFile = "";
        }
        /*this.projectList.forEach((obj)=>{
          if(row.projectId == obj.projectId){
            this.projectForm = obj;
            // 获取当前选中的附件信息
            this.fileName = obj.invitation;
          }
        });*/

        this.memberList.forEach((obj)=>{
          if(row.teamNo === obj.teamNo){
            this.memberData.push(obj);
          }
        });
        this.selectTeamNo = row.teamNo;
        this.competitionName = row.project.name ;
        this.editForm = Object.assign({}, row);

        /*// this.competitionName = row.name;
        this.dialogStatus = 'detail';
        this.dialogFormVisible = true;
        this.memberData = [];
        this.projectForm = {};

        this.projectList.forEach((obj)=>{
          if(row.projectId == obj.projectId){
            this.projectForm = obj;
            // 获取当前选中的附件信息
            this.fileName = obj.invitation;
          }
        });
        this.memberList.forEach((obj)=>{
          if(row.teamNo === obj.teamNo){
            this.memberData.push(obj);
            console.log("最外面的详情===");
          }
        });
        this.editForm = Object.assign({}, row);*/
      },
      // 修改团队成员信息
      editMember(){
        // this.memberData.
        this.memberData[this.memberIndex] = this.member;
        this.innerVisible = false;
      },
      // 全选单选多选
      selsChange(sels) {
        this.sels = sels
      },
      // 跳转到某页
      handleCurrentChange(val) {
        // 获取当前页
        this.page = val;
        // 重新获取数据
        this.getConclusion();
      },
      // 改变每页条数
      handleSizeChange(val){
        this.limit = val;
        this.getConclusion();
      },

      formatStatus: function (row) {
        if (row.status === "0") {
          return "待提交";
        } else if (row.status === "1") {
          return "待审核";
        } else if (row.status === "2") {
          return "不通过";
        } else if (row.status === "3") {
          return "已批准";
        }
      },
      formatRanking(row){
        if(row.prize.ranking === "14"){
          return "特等奖";
        }else if (row.prize.ranking === "1"){
          return "一等奖";
        } else if (row.prize.ranking === "2"){
          return "二等奖";
        } else if (row.prize.ranking === "3"){
          return "三等奖";
        }else if (row.prize.ranking === "5"){
          return "优秀奖";
        }else if (row.prize.ranking === "0"){
          return "无";
        }

      },
      formatLevel(row){
        if (row.prize.level === "14"){
          return "国家级";
        }else if (row.prize.level === "1"){
          return "区级";
        } else if (row.prize.level === "2"){
          return "校级";
        }else if (row.prize.level === "0"){
          return "无";
        }

      },
      formatTeacherNo:function(row, column){
        this.teacherList.forEach((obj)=>{
          if (obj.teacherId == row.teacherNo){
            row.teacherNo = obj.teacherName;
          }
        });

      },


    },
  }
</script>

<style scoped>
  a:link {color:blue;} /* 未访问的链接 */
  a:visited {color:orange;} /* 已访问的链接 */
  a:hover {color:green;} /* 鼠标划过链接 */
  a:active {color:red;} /* 已选中的链接 */


  .file {
    position: relative;
    display: inline-block;
    background: #D0EEFF;
    border: 1px solid #99D3F5;
    border-radius: 4px;
    padding: 4px 12px;
    overflow: hidden;
    color: #1E88C7;
    text-decoration: none;
    text-indent: 0;
    line-height: 20px;
  }
  .file input {
    position: absolute;
    font-size: 100px;
    right: 0;
    top: 0;
    opacity: 0;
    cursor: pointer
  }
  .file:hover {
    background: #AADFFD;
    border-color: #78C3F3;
    color: #004974;
    text-decoration: none;
  }
</style>
